﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using PSE.Framework.UI.Resources;

namespace Sinacor.Infra.UI.Common.EnumWrapper.WeakEventManagers
{
    internal class ResourceChangedEventManager : BaseWeakEventManager<ResourceChangedEventManager, IResourceProvider, EventArgs>
    {
        protected override void StartListening(object source)
        {
            IResourceProvider s = source as IResourceProvider;
            if (s != null)
                s.ResourceChanged += new EventHandler(HandleEvent);
        }

        protected override void StopListening(object source)
        {
            IResourceProvider s = source as IResourceProvider;
            if (s != null)
                s.ResourceChanged -= new EventHandler(HandleEvent);
        }
    }
}
